]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
dnd: Also consider indirect scaling of dnd actor
authorSebastian Keller <skeller@gnome.org>
Wed, 17 Feb 2021 00:00:27 +0000 (01:00 +0100)
committerMarge Bot <marge-bot@gnome.org>
Wed, 17 Feb 2021 10:12:00 +0000 (10:12 +0000)
Some actors don't have the scale applied to them directly but are
children of a scaled parent. In those case just retaining the scale will
not be enough and the scale of the actor itself needs to be adjusted
when reparenting. This could for example be seen when dragging windows
from the workspace thumbnails.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1687>

js/ui/dnd.js

index 6b4a9838233e3ea5971d35eae471c5328598d5cf..0e972a13d75ecf62b6d808377b078fca7c26e572 100644 (file)
@@ -400,6 +400,9 @@ var _Draggable = class _Draggable {
             scaledWidth = transformedExtents.get_width();
             scaledHeight = transformedExtents.get_height();
 
+            this._dragActor.scale_x = scaledWidth / this._dragOrigWidth;
+            this._dragActor.scale_y = scaledHeight / this._dragOrigHeight;
+
             this._dragOrigParent.remove_actor(this._dragActor);
             Main.uiGroup.add_child(this._dragActor);
             Main.uiGroup.set_child_above_sibling(this._dragActor, null);